
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/region.css" />
    <!--css-->
    <link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/car.css" />
    <!--组件依赖js begin-->
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.extend.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.ui.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.fix.js"></script>
    <!--刷新-->
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/refresh.js"></script>
    <style type="text/css">
    /*加载*/
    
    .ui-refresh-down {
        height: 42px;
        border-top: 1px solid #e4e4e4;
        border-bottom: 1px solid #e4e4e4;
        line-height: 42px;
        background: #f0f0f0;
        text-align: center;
    }
    
    .ui-refresh-icon {
        display: inline-block;
        content: '';
        background:url({MODULE_URL}template/mobile/style/style1/static/image/arrow-down.png) no-repeat;
        width: 12px;
        background-size: 12px;
        height: 7px;
        margin-right: 5px;
    }
    
    .ui-refresh-icon {
        display: inline-block;
        content: '';
        background:url({MODULE_URL}template/mobile/style/style1/static/image/arrow-down.png) no-repeat;
        width: 12px;
        background-size: 12px;
        height: 7px;
        margin-right: 5px;
    }
    
    .ui-loading {
        display: inline-block;
        content: '';
        background:url({MODULE_URL}template/mobile/style/style1/static/image/loading.gif) no-repeat;
        width: 16px;
        background-size: 16px;
        height: 16px;
        margin-right: 5px;
    }
    </style>
    <title>{$region['title']}</title>
</head>

<body>
    <!--page-->
    <div id="page">
        <header id="header">
            <div class="header_div">
                <div id="left_div" onClick="window.location.href='{php echo $this->createMobileUrl('nav')}'"></div>
                <div id="middle_div">
                    <!-- <a href="javascript:void(0)" class="car_sx"><span>筛&nbsp;选</span></a> -->
                    <h1 id="title">拼车列表</h1>
                </div>
                <div id="right_div">
                    <div class="right_bottom"></div>
                    <div class="right_img">筛选</div>
                </div>
            </div>
        </header>
        <!--cont-->
        <div class="cont">
            <aside class="pc_search">
                <form action="" method="post" id="sxForm">
                    <div class="close"><span>X</span></div>
                    <div id="tjsx">
                        <div class="sx">筛选条件</div>
                        <div class="tj">
                            <dl class="block2">
                                <dt>座位：</dt>
                                <dd class="cattsel">不限
                                    <input name="driver_seat" type="radio" value="" checked/>
                                </dd>
                                <dd>1人
                                    <input name="driver_seat" type="radio" value="1" />
                                </dd>
                                <dd>2人
                                    <input name="driver_seat" type="radio" value="2" />
                                </dd>
                                <dd>3人
                                    <input name="driver_seat" type="radio" value="3" />
                                </dd>
                                <dd>≥4人
                                    <input name="driver_seat" type="radio" value="4" />
                                </dd>
                            </dl>
      <!--                       <dl class="block2">
                                <dt>车型：</dt>
                                <dd class="cattsel">不限
                                    <input name="driver_models" type="radio" value="" checked/>
                                </dd>
                                <dd>轿车
                                    <input name="driver_models" type="radio" value="轿车" />
                                </dd>
                                <dd>吉普
                                    <input name="driver_models" type="radio" value="吉普" />
                                </dd>
                                <dd>面包车
                                    <input name="driver_models" type="radio" value="面包车" />
                                </dd>
                                <dd>越野车
                                    <input name="driver_models" type="radio" value="越野车" />
                                </dd>
                                <dd>商务车
                                    <input name="driver_models" type="radio" value="商务车" />
                                </dd>
                                <dd>其他
                                    <input name="driver_models" type="radio" value="其他" />
                                </dd>
                            </dl> -->
                            <dl class="block2">
                                <dt>费用：</dt>
                                <dd class="cattsel">不限
                                    <input name="driver_price" type="radio" value="1000000" checked/>
                                </dd>
                                <dd>0-20元
                                    <input name="driver_price" type="radio" value="20" />
                                </dd>
                                <dd>20-40元
                                    <input name="driver_price" type="radio" value="40" />
                                </dd>
                                <dd>40-60元
                                    <input name="driver_price" type="radio" value="60" />
                                </dd>
                                <dd>≥60元
                                    <input name="driver_price" type="radio" value="1000" />
                                </dd>
                            </dl>
                            <dl class="block2">
                                <dt>目的地：</dt>
                                <input type="text" name="driver_destination" value="" placeholder="请填写目的地" class="mdd" />
                            </dl>
                        </div>
                        <a href="javascript:void(0)" onclick="$('#sxForm').submit();" class="btn-tj"><span>提交信息</span></a>
                    </div>
                </form>
            </aside>
            <script>
            $(function() {
                $(".pc_search").height($("#page").height())
                $(".right_img").click(function() {
                    $(".pc_search").addClass("ok_search");
                })
                $(".close").click(function() {
                    $(".pc_search").removeClass("ok_search");
                })
                $(".tj dl dd").click(function() {
                    $(this).attr("class", "cattsel");
                    $(this).siblings("dd").removeAttr("class");
                    changeAtt(this)
                })

            })

            function changeAtt(t) {
                t.lastChild.checked = 'checked';
            }
            </script>
            <aside class="tab_title">
                <a href="{php echo $this->createMobileUrl('car',array('op' => 'list','type' => 1))}" {if $type == 1}class="active"{/if}><span class="tabt sj_title" style='font-size:12px;'>司机发布</span></a>
                <a href="{php echo $this->createMobileUrl('car',array('op' => 'list','type' => 2))}" {if $type == 2}class="active"{/if}><span class="tabt ck_title" style='font-size:12px;'>乘客发布</span></a>
            </aside>
            <section>
                <div class="ui-refresh" id="car">
                    <ul class="data-list">
                    
                    </ul>
                    {if $total>9}
                    <div class="ui-refresh-down"></div>
                    {/if}
                </div>
            </section>
        </div>
    </div>
    <!--cont end-->
    <!--右边点击菜单-->
    <div id="btn_div">
        <div id="btn_dj"><span id="btn_input" class="btn_img hide_b"></span></div>
        <div id="menu_b" class="menu_btn hide_m">
            <a href="{php echo $this->createMobileUrl('car',array('op' => 'add'))}">发布信息</a><a href="{php echo $this->createMobileUrl('car',array('op' => 'my'))}">我的发布</a></div>
    </div>
    <script>
    $(function() {
        $("#btn_div").fix({
            right: 0,
            bottom: 120
        })
        $("#btn_dj").click(function() {
            var input_btn = $("#btn_input")
            if (input_btn.attr("class") == "btn_img hide_b") {
                input_btn.removeClass();
                input_btn.addClass("btn_img show_b");
            } else {
                input_btn.removeClass();
                input_btn.addClass("btn_img hide_b");
            }
            var menu_b = $("#menu_b")
            if (menu_b.attr("class") == "menu_btn hide_m") {
                menu_b.removeClass();
                menu_b.addClass("menu_btn show_m");
            } else {
                menu_b.removeClass();
                menu_b.addClass("menu_btn hide_m");
            }
        })
    })
    </script>
     <script>
    /*ajax请求函数,判断共几页，呈现不同效果*/
    (function() {
        xqAjax();

        function xqAjax() {
            var url = "{php echo $this->createMobileUrl('car',array('op' => 'list'))}";
            var type = "{$type}";
            $.ajax({
                url: url,
                async: false,
                type: 'post',
                dataType: 'json',
                data: {
                    type:type
                },
                beforeSend: function() {
                    $("#data-list").html("<li class='seach_loading'><img src='{MODULE_URL}template/mobile/style/style1/static/image/loading.gif'/>为您搜索中……</li>")
                },
                success: function(data) {

                    var $list = $('.data-list'),
                        html = (function(data) { //数据渲染
                            var liArr = [];
                            $.each(data.allhtml, function() {
                                liArr.push(this.html);
                            });
                            return liArr.join('');
                        })(data);

                    $('.data-list').html(html)
                    if (data.page_count < 2) {
                        $(".ui-refresh-down").html("<span class='ui-refresh-label'>没有更多内容了</span>");
                    } else {
                        refreshFun();
                    }

                },
                // error: function() {
                //     alert('请求不到数据，请重新搜索！');
                // }

            })
        }

        /*组件初始化refreshFun函数*/

        function refreshFun() {
            var index = 1;
            $('.ui-refresh').refresh({
                ready: function(dir, type) {
                    var me = this;
                    var type = "{$type}";
                    index++;
                    $.getJSON("{php echo $this->createMobileUrl('car',array('op' => 'list'))}", {
                        page: index,
                        type:type
                    }, function(data) {
                        var $list = $('.data-list'),
                            html = (function(data) { //数据渲染
                                var liArr = [];
                                $.each(data.allhtml, function() {
                                    liArr.push(this.html);
                                });
                                return liArr.join('');
                            })(data);

                        $list[dir == 'up' ? 'prepend' : 'append'](html);
                        if (index < data.page_count) {
                            me.afterDataLoading();
                        } else {
                            me.disable(dir, false);
                        }
                    });
                }
            });

        }
        /*组件初始化js end*/
    })();

    $(function() {
        select('a1');
    });
    </script>
    {template 'style/style1/footer'}
</body>

</html>
